<?php

/**
 * This file is part of the Framework03 PHP framework.
 * @author Walter Tamboer
 * @package Framework03
 */


class FW_Date
{
    /**
     * @var int The unix time that is used to work with.
     */
    private $unixTime = 0;

    /**
     * Initializes a new instance of this class.
     * @param string $date The date to parse.
     */
    public function __construct($date)
    {
        $this->unixTime = strtotime($date);
    }
    
    /**
     * Gets the year of this date.
     * @return int
     */
    public function getYear()
    {
        return date('Y', $this->unixTime);
    }

    /**
     * Gets the month of this date.
     * @return int
     */
    public function getMonth()
    {
        return date('m', $this->unixTime);
    }

    /**
     * Gets the day of this date.
     * @return int
     */
    public function getDay()
    {
        return date('d', $this->unixTime);
    }
}
